//
//  HQHomeViewController.swift
//  TodayNews
//
//  Created by 郝庆 on 16/8/22.
//  Copyright © 2016年 haoqing. All rights reserved.
//

import UIKit

class HQHomeViewController: UIViewController {
    
    // MARK: - 懒加载属性
    private lazy var scrollView: UIScrollView = UIScrollView()
    private lazy var titleView: HQScrollTitleView = HQScrollTitleView()

    override func viewDidLoad() {
        super.viewDidLoad()
        // 设置UI
        setupUI()
    }

}

// MARK: - 设置UI
extension HQHomeViewController {
    private func setupUI() {
        view.backgroundColor = HQGlobalColor()
        //不要自动调整inset
        automaticallyAdjustsScrollViewInsets = false
        // 设置导航栏属性
        navigationController?.navigationBar.barStyle = .Black
        navigationController?.navigationBar.barTintColor = HQColor(210, g: 63, b: 66, a: 1.0)
        
        // 设置titleView
        navigationItem.titleView = titleView
        // 添加滚动视图
        scrollView.frame = UIScreen.mainScreen().bounds
        scrollView.pagingEnabled = true
        view.addSubview(scrollView)
    }

}
